﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ObjCatManage.aspx.cs" Inherits="Admin.ObjCatManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
	<style type="text/css">
		body{font-size:12px;font-family:font-family:"宋体","Arial",\5B8B\4F53,Helvetica,sans-serif;background-color:#fff;}
		
	.GridFrame
{
    margin-top: 5px;
    border-collapse: collapse;
    border-right: #7c9ccf 1px solid;
    border-top: #7c9ccf 1px solid;
    border-left: #7c9ccf 1px solid;
    border-bottom: #7c9ccf 1px solid;
}
.GridItem td ,.GridAlter td
{
    border-right: #999999 1px solid;
    border-top: #999999 1px solid;
    border-left: #999999 1px solid;
    border-bottom: #999999 1px solid;
}
.GridItem
{
    font-family: arial;
    font-size: 9pt;
    background: #f1f1f1;
    padding: 0px 4px 0px 4px;
    height: 14px;
}

.GridEdit
{
    font-family: arial;
    font-size: 9pt;
    background: #ffffff;
    padding: 0px 4px 0px 4px;
    height: 14px;
}

.GridEdit td ,.GridAlter td
{
    border-right: #999999 1px solid;
    border-top: #999999 1px solid;
    border-left: #999999 1px solid;
    border-bottom: #999999 1px solid;
}

.GridHeader
{
    font: bold ;
    font-family: 宋体;
    font-size: 9pt;
    background: #8caae7;
    border-bottom: #7c9ccf 1px solid;
    border-top: #7c9ccf 1px solid;
    border-left: #7c9ccf 1px solid;
    border-right: #7c9ccf 1px solid;
    color: #ffffff;
    text-align:center;
    height:18px;
}
.GridHeader th
{
    font: bold ;
    font-family: 宋体;
    font-size: 9pt;
    background: #8caae7;
    border-bottom: #7c9ccf 1px solid;
    border-top: #7c9ccf 1px solid;
    color: #ffffff;
    text-align:center;
}

.GridAlter
{
    font-family: arial;
    font-size: 9pt;
    background: #f1f1f1;
    padding: 0px 4px 0px 4px;
    height: 14px;
}
	
		.style1
		{
			width: 100%;
		}
		.style2
		{
			width: 108px;
		}
		.style4
		{
			width: 217px;
		}
		.style6
		{
		}
		.style7
		{
			width: 104px;
		}
		.style8
		{
			width: 106px;
		}
	
	</style>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    	类目名称：<asp:TextBox ID="tbName" runat="server" Width="207px"></asp:TextBox>
		<asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="增加" />
		<asp:Button ID="btnRefresh" runat="server" onclick="btnRefresh_Click" 
			Text="重新打开" />

    </div>
    <div>
		<table class="style1">
			<tr>
				<td class="style2" valign="top">
		<asp:TreeView ID="tvCat" runat="server" 
			onselectednodechanged="tvCat_SelectedNodeChanged" 
			ontreenodecollapsed="tvCat_TreeNodeCollapsed">
							<SelectedNodeStyle BackColor="Red" BorderColor="Blue" ForeColor="White" />

		</asp:TreeView>
				</td>
				<td valign=top>
					<div id="divProp" runat="server" visible="false">
						<div>
						<asp:LinkButton ID="lbAddProp" runat="server" Text="增加属性" onclick="lbAddProp_Click"></asp:LinkButton>
						</div>
						<div>
						<asp:GridView ID="gvProp" runat="server" AutoGenerateColumns="False" 
								CellPadding="4" DataKeyNames="cat_pid"
				ForeColor="#333333" GridLines="None" 
								OnRowCommand="gvProp_RowCommand" EnableModelValidation="True">
				<RowStyle CssClass="GridItem" />
<EditRowStyle CssClass="GridEdit" />

<SelectedRowStyle CssClass="GridHeader" />

<PagerStyle CssClass="GridItem" />

<HeaderStyle CssClass="GridHeader" />

<FooterStyle CssClass="GridFooter" />

<AlternatingRowStyle CssClass="GridAlter" />
				<Columns>
					<asp:BoundField DataField="pid" HeaderText="属性ID" HeaderStyle-Width="50" />
					<asp:BoundField DataField="pname" HeaderText="属性名" HeaderStyle-Width="150"/>
					<asp:TemplateField HeaderText="数据类型" HeaderStyle-Width="60"><ItemTemplate><%# GetDataTypeString(Eval("data_type"))%></ItemTemplate></asp:TemplateField>
					<asp:TemplateField HeaderText="数据大小" HeaderStyle-Width="60"><ItemTemplate><%# Eval("data_size")%></ItemTemplate></asp:TemplateField>
					<asp:BoundField DataField="is_key_prop" HeaderText="关键属性" HeaderStyle-Width="60"/>
					<asp:BoundField DataField="is_enum_prop" HeaderText="可枚举属性" HeaderStyle-Width="70"/>
					<asp:BoundField DataField="is_input_prop" HeaderText="可输入属性" HeaderStyle-Width="70"/>
					<asp:BoundField DataField="must" HeaderText="必须属性" HeaderStyle-Width="60"/>
					<asp:BoundField DataField="sort_order" HeaderText="排序" HeaderStyle-Width="50"/>
					<asp:BoundField DataField="field_title" HeaderText="映射" HeaderStyle-Width="100"/>
					<asp:BoundField DataField="status" HeaderText="状态" HeaderStyle-Width="50"/>
					<asp:TemplateField>
						<ItemTemplate>
							<asp:LinkButton ID="lbEdit" CommandArgument='<%# Eval("cat_pid") %>' CommandName="PropEdit" runat="server" Text="编辑"></asp:LinkButton>
							<asp:LinkButton ID="lbFieldMap" CommandArgument='<%# Eval("cat_pid") %>' CommandName="FieldMap" runat="server" Text="映射"></asp:LinkButton>
						</ItemTemplate>
					</asp:TemplateField>
				</Columns>
			</asp:GridView>
						
						</div>
					</div>
					<div id="divAddProp" runat="server" visible="false">
						
						<table>
							<tr>
								<td align="right" class="style8">
									属性名：</td>
								<td class="style4">
									<asp:TextBox ID="tbPropName" runat="server" Width="208px"></asp:TextBox>
								</td>
								<td align="right" class="style7">
									必须：</td>
								<td>
									<asp:DropDownList ID="ddlMust" runat="server">
										<asp:ListItem Value="1" Selected="True">是</asp:ListItem>
										<asp:ListItem Value="0">否</asp:ListItem>
									</asp:DropDownList>
								</td>
							</tr>
							<tr>
								<td align="right" class="style8">
									数据类型：</td>
								<td class="style4">
									<asp:DropDownList ID="ddlDataType" runat="server">
										<asp:ListItem Value="1" Selected="True">词</asp:ListItem>
										<asp:ListItem Value="2">文本</asp:ListItem>
										<asp:ListItem Value="3">库</asp:ListItem>
									</asp:DropDownList>
								</td>
								<td align="right" class="style7">
									数据大小 ：</td>
								<td>
									<asp:TextBox ID="tbDataSize" runat="server" Width="208px">0</asp:TextBox>
								</td>
							</tr>
							<tr>
								<td align="right" class="style8">
									是否关键属性：</td>
								<td class="style4">
									<asp:DropDownList ID="ddlPropKey" runat="server">
										<asp:ListItem Value="1">是</asp:ListItem>
										<asp:ListItem Value="0" Selected="True">否</asp:ListItem>
									</asp:DropDownList>
								</td>
								<td align="right" class="style7">
									排序：</td>
								<td>
									<asp:TextBox ID="tbSortOrder" runat="server" Width="65px">0</asp:TextBox>
								</td>
							</tr>
							<tr>
								<td align="right" class="style8">
									是否可枚举属性：</td>
								<td class="style4">
									<asp:DropDownList ID="ddlPropEnum" runat="server">
										<asp:ListItem Value="1">是</asp:ListItem>
										<asp:ListItem Value="0" Selected="True">否</asp:ListItem>
									</asp:DropDownList>
								</td>
								<td align="right" class="style7" valign="top">
									是否可输入属性：</td>
								<td>
									<asp:DropDownList ID="ddlPropInput" runat="server">
										<asp:ListItem Value="1">是</asp:ListItem>
										<asp:ListItem Value="0" Selected="True">否</asp:ListItem>
									</asp:DropDownList>
								</td>
							</tr>
							<tr>
								<td align="right" class="style8">
									状态：</td>
								<td class="style4">
									<asp:DropDownList ID="ddlPropStatus" runat="server">
										<asp:ListItem Value="1">正常</asp:ListItem>
										<asp:ListItem Value="0">删除</asp:ListItem>
									</asp:DropDownList>
								</td>
								<td align="right" class="style7">
									&nbsp;</td>
								<td>
									&nbsp;</td>
							</tr>
							<tr>
								<td align="center" class="style6" colspan="4">
									<asp:Button ID="btnOK" runat="server" onclick="btnOK_Click" Text="确定" />
									<asp:Button ID="btnBack" runat="server" Text="返回" onclick="btnBack_Click" />
								</td>
							</tr>
						</table>
						
					</div>



						<div id="divFieldMapSet" runat="server" visible="false">
									<asp:DropDownList ID="ddlCrawlJob" runat="server" 
										onselectedindexchanged="ddlCrawlJob_SelectedIndexChanged" AutoPostBack="True">
									</asp:DropDownList>
									<asp:DropDownList ID="ddlCrawlFile" runat="server" 
										onselectedindexchanged="ddlCrawlFile_SelectedIndexChanged" AutoPostBack="True">
									</asp:DropDownList>
									<asp:DropDownList ID="ddlCrawlField" runat="server">
									</asp:DropDownList>
			<asp:Button ID="btnSetField" runat="server" Text="确定" onclick="btnSetField_Click" />
			<asp:Button ID="btnReturnPropList" runat="server" Text="返回" onclick="btnReturnPropList_Click" />
							</div>
					
					</td>
			</tr>
		</table>
	</div>

    </form>
</body>
</html>
